
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: class Resource</title>
</head><body bgcolor="#f0f0f8">
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Resource">class <strong>Resource</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;class&nbsp;for&nbsp;interacting&nbsp;with&nbsp;a&nbsp;resource.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<dl><dt><a name="Resource-generate"><strong>generate</strong></a> = method(self, **kwargs)</dt><dd><tt>Generate&nbsp;an&nbsp;AdSense&nbsp;report&nbsp;based&nbsp;on&nbsp;the&nbsp;report&nbsp;request&nbsp;sent&nbsp;in&nbsp;the&nbsp;query&nbsp;parameters.&nbsp;Returns&nbsp;the&nbsp;result&nbsp;as&nbsp;JSON;&nbsp;to&nbsp;retrieve&nbsp;output&nbsp;in&nbsp;CSV&nbsp;format&nbsp;specify&nbsp;"alt=csv"&nbsp;as&nbsp;a&nbsp;query&nbsp;parameter.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;sort:&nbsp;string,&nbsp;The&nbsp;name&nbsp;of&nbsp;a&nbsp;dimension&nbsp;or&nbsp;metric&nbsp;to&nbsp;sort&nbsp;the&nbsp;resulting&nbsp;report&nbsp;on,&nbsp;optionally&nbsp;prefixed&nbsp;with&nbsp;"+"&nbsp;to&nbsp;sort&nbsp;ascending&nbsp;or&nbsp;"-"&nbsp;to&nbsp;sort&nbsp;descending.&nbsp;If&nbsp;no&nbsp;prefix&nbsp;is&nbsp;specified,&nbsp;the&nbsp;column&nbsp;is&nbsp;sorted&nbsp;ascending.&nbsp;(repeated)<br>
&nbsp;&nbsp;startDate:&nbsp;string,&nbsp;Start&nbsp;of&nbsp;the&nbsp;date&nbsp;range&nbsp;to&nbsp;report&nbsp;on&nbsp;in&nbsp;"YYYY-MM-DD"&nbsp;format,&nbsp;inclusive.&nbsp;(required)<br>
&nbsp;&nbsp;endDate:&nbsp;string,&nbsp;End&nbsp;of&nbsp;the&nbsp;date&nbsp;range&nbsp;to&nbsp;report&nbsp;on&nbsp;in&nbsp;"YYYY-MM-DD"&nbsp;format,&nbsp;inclusive.&nbsp;(required)<br>
&nbsp;&nbsp;currency:&nbsp;string,&nbsp;Optional&nbsp;currency&nbsp;to&nbsp;use&nbsp;when&nbsp;reporting&nbsp;on&nbsp;monetary&nbsp;metrics.&nbsp;Defaults&nbsp;to&nbsp;the&nbsp;account's&nbsp;currency&nbsp;if&nbsp;not&nbsp;set.<br>
&nbsp;&nbsp;locale:&nbsp;string,&nbsp;Optional&nbsp;locale&nbsp;to&nbsp;use&nbsp;for&nbsp;translating&nbsp;report&nbsp;output&nbsp;to&nbsp;a&nbsp;local&nbsp;language.&nbsp;Defaults&nbsp;to&nbsp;"en_US"&nbsp;if&nbsp;not&nbsp;specified.<br>
&nbsp;&nbsp;metric:&nbsp;string,&nbsp;Numeric&nbsp;columns&nbsp;to&nbsp;include&nbsp;in&nbsp;the&nbsp;report.&nbsp;(repeated)<br>
&nbsp;&nbsp;maxResults:&nbsp;integer,&nbsp;The&nbsp;maximum&nbsp;number&nbsp;of&nbsp;rows&nbsp;of&nbsp;report&nbsp;data&nbsp;to&nbsp;return.<br>
&nbsp;&nbsp;filter:&nbsp;string,&nbsp;Filters&nbsp;to&nbsp;be&nbsp;run&nbsp;on&nbsp;the&nbsp;report.&nbsp;(repeated)<br>
&nbsp;&nbsp;startIndex:&nbsp;integer,&nbsp;Index&nbsp;of&nbsp;the&nbsp;first&nbsp;row&nbsp;of&nbsp;report&nbsp;data&nbsp;to&nbsp;return.<br>
&nbsp;&nbsp;dimension:&nbsp;string,&nbsp;Dimensions&nbsp;to&nbsp;base&nbsp;the&nbsp;report&nbsp;on.&nbsp;(repeated)<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;An&nbsp;object&nbsp;of&nbsp;the&nbsp;form<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;"kind":&nbsp;"adsense#report",&nbsp;#&nbsp;Kind&nbsp;this&nbsp;is,&nbsp;in&nbsp;this&nbsp;case&nbsp;adsense#report.<br>
&nbsp;&nbsp;&nbsp;&nbsp;"rows":&nbsp;[&nbsp;#&nbsp;The&nbsp;output&nbsp;rows&nbsp;of&nbsp;the&nbsp;report.&nbsp;Each&nbsp;row&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;cells;&nbsp;one&nbsp;for&nbsp;each&nbsp;dimension&nbsp;in&nbsp;the&nbsp;request,&nbsp;followed&nbsp;by&nbsp;one&nbsp;for&nbsp;each&nbsp;metric&nbsp;in&nbsp;the&nbsp;request.&nbsp;The&nbsp;dimension&nbsp;cells&nbsp;contain&nbsp;strings,&nbsp;and&nbsp;the&nbsp;metric&nbsp;cells&nbsp;contain&nbsp;numbers.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"A&nbsp;String",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;&nbsp;&nbsp;"warnings":&nbsp;[&nbsp;#&nbsp;Any&nbsp;warnings&nbsp;associated&nbsp;with&nbsp;generation&nbsp;of&nbsp;the&nbsp;report.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"A&nbsp;String",<br>
&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;&nbsp;&nbsp;"totals":&nbsp;[&nbsp;#&nbsp;The&nbsp;totals&nbsp;of&nbsp;the&nbsp;report.&nbsp;This&nbsp;is&nbsp;the&nbsp;same&nbsp;length&nbsp;as&nbsp;any&nbsp;other&nbsp;row&nbsp;in&nbsp;the&nbsp;report;&nbsp;cells&nbsp;corresponding&nbsp;to&nbsp;dimension&nbsp;columns&nbsp;are&nbsp;empty.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"A&nbsp;String",<br>
&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;&nbsp;&nbsp;"headers":&nbsp;[&nbsp;#&nbsp;The&nbsp;header&nbsp;information&nbsp;of&nbsp;the&nbsp;columns&nbsp;requested&nbsp;in&nbsp;the&nbsp;report.&nbsp;This&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;headers;&nbsp;one&nbsp;for&nbsp;each&nbsp;dimension&nbsp;in&nbsp;the&nbsp;request,&nbsp;followed&nbsp;by&nbsp;one&nbsp;for&nbsp;each&nbsp;metric&nbsp;in&nbsp;the&nbsp;request.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"currency":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;The&nbsp;currency&nbsp;of&nbsp;this&nbsp;column.&nbsp;Only&nbsp;present&nbsp;if&nbsp;the&nbsp;header&nbsp;type&nbsp;is&nbsp;METRIC_CURRENCY.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;The&nbsp;type&nbsp;of&nbsp;the&nbsp;header;&nbsp;one&nbsp;of&nbsp;DIMENSION,&nbsp;METRIC_TALLY,&nbsp;METRIC_RATIO,&nbsp;or&nbsp;METRIC_CURRENCY.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"name":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;header.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br>
&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;&nbsp;&nbsp;"totalMatchedRows":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;The&nbsp;total&nbsp;number&nbsp;of&nbsp;rows&nbsp;matched&nbsp;by&nbsp;the&nbsp;report&nbsp;request.&nbsp;Fewer&nbsp;rows&nbsp;may&nbsp;be&nbsp;returned&nbsp;in&nbsp;the&nbsp;response&nbsp;due&nbsp;to&nbsp;being&nbsp;limited&nbsp;by&nbsp;the&nbsp;row&nbsp;count&nbsp;requested&nbsp;or&nbsp;the&nbsp;report&nbsp;row&nbsp;limit.<br>
&nbsp;&nbsp;&nbsp;&nbsp;"averages":&nbsp;[&nbsp;#&nbsp;The&nbsp;averages&nbsp;of&nbsp;the&nbsp;report.&nbsp;This&nbsp;is&nbsp;the&nbsp;same&nbsp;length&nbsp;as&nbsp;any&nbsp;other&nbsp;row&nbsp;in&nbsp;the&nbsp;report;&nbsp;cells&nbsp;corresponding&nbsp;to&nbsp;dimension&nbsp;columns&nbsp;are&nbsp;empty.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"A&nbsp;String",<br>
&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;}</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table>
</body></html>